package com.xxxx.seckill.config;

import com.xxxx.seckill.pojo.User;

/**
 * <p>
 * useContext
 * </p>
 *
 * @author heyanfeng
 * @since 2022-08-01
 */
public class UserContext {


    private static ThreadLocal<User> userThreadLocal = new ThreadLocal<>();

    public static void setUser(User user) {
        userThreadLocal.set(user);
    }

    public static User getUser() {
        return userThreadLocal.get();
    }
}
